import service from "@/utils/request";

// 查询角色列表
export const getRoleListApi = (params) => {
  return service({
    url: "/permission/role",
    method: "get",
    params,
  });
};

// 编辑角色回显
export const editRoleInfoApi = (id) => {
  return service({
    url: "/permission/role/" + id,
    method: "get",
  });
};
// 添加角色列表
export const addRoleListApi = (data) => {
  return service({
    url: "/permission/role",
    method: "post",
    data,
  });
};
// 编辑角色
export const editRoleApi = (data) => {
  return service({
    url: "permission/role/" + data.id,
    method: "put",
    data,
  });
};
// 删除角色
export const delRoleApi = (id) => {
  return service({
    url: "permission/role/" + id,
    method: "DELETE",
  });
};
// 获取角色信息
export const getRoleInfoApi = () => {
  return service({
    url: "/permission/menu",
    method: "get",
  });
};

// 获取题库信息
export const getExamListApi = (params) => {
  return service({
    url: "http://192.168.19.90:7005/admin/exam/question?",
    method: "get",
    params,
  });
};

// 获取个人信息
export const getUserApi = () => {
  return service({
    url: "/index/userinfo",
    method: "post",
  });
};
